package com.example.blue.musicplay.basic;


import android.graphics.BitmapFactory.Options;

/**
 * Created by blue on 2016/9/20.
 */

public class ImageViewSizeUtils {
    public int clacImageSize(Options options,int reqWidth,int reqHeight) {
        int width = options.outWidth;
        int height =options.outHeight;
        int sampSize = 1;
        if (width > reqWidth||height > reqHeight) {
            int widthRadio = Math.round(width * 1.0f /reqWidth);
            int heightRadio = Math.round(height* 1.0f /reqHeight);
            sampSize = Math.max(widthRadio,heightRadio);
        }
        return sampSize;
    }
}
